package cn.zust.edu.cn.pojo;

import cn.zust.edu.cn.service.IShape;

public class Triangle implements IShape {

    Point ptA;

    Point ptB;

    Point ptC;

    private double edgeA;

    private double edgeB;

    private double edgeC;

    public double getEdgeA() {
        return edgeA;
    }

    public void setEdgeA(double edgeA) {
        this.edgeA = edgeA;
    }

    public double getEdgeB() {
        return edgeB;
    }

    public void setEdgeB(double edgeB) {
        this.edgeB = edgeB;
    }

    public double getEdgeC() {
        return edgeC;
    }

    public void setEdgeC(double edgeC) {
        this.edgeC = edgeC;
    }



    public Triangle(Point ptA, Point ptB, Point ptC) {
        this.ptA = ptA;
        this.ptB = ptB;
        this.ptC = ptC;
    }

    @Override
    public double perimeter(){
        return edgeA+edgeB+edgeC;
    }

    @Override
    public double area(){
        double p=(edgeA+edgeB+edgeC)/2;
        return Math.sqrt(p*(p-edgeA)*(p-edgeB)*(p-edgeC));
    }

    @Override
    public void draw(){
        System.out.println("triangle");
    }

}